<?php
declare (strict_types=1);

namespace app\api\validate;

use think\Validate;

class PasswordValidate extends Validate
{
    /**
     * 定义验证规则
     * 格式：'字段名' =>  ['规则1','规则2'...]
     *
     * @var array
     */
    protected $rule = [
        'safety_code|交易密码' => 'length:6',
        'password|密码'      => 'length:6,20|chsAlphaNum',
    ];

    protected $message = [
        'password.length'      => '密码只能在6到20位之间',
        'password.chsAlphaNum' => '密码只能由字母数字组成',
        'safety_code.length'   => '交易密码需要六位',
    ];
}
